//
//  HotelRootItemCell.m
//  Traveling
//
//  Created by 尹桥印 on 15/6/10.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "HotelRootItemCell.h"

@interface HotelRootItemCell()

@property (nonatomic, weak) IBOutlet UILabel *typenameLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@property (weak, nonatomic) IBOutlet UIImageView *wifiView;
@property (weak, nonatomic) IBOutlet UIImageView *breakfastView;
@property (weak, nonatomic) IBOutlet UIImageView *coverImage;
@end

@implementation HotelRootItemCell

+(instancetype)initWithTableView:(UITableView *)tableView{
    static NSString *identifier = @"HotelRootItemCell";
    HotelRootItemCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    return cell;
}
-(void)setItemInfo:(HotelRoomItemInfo *)itemInfo{
    _itemInfo = itemInfo;
    self.typenameLabel.text = [NSString stringWithFormat:@"房型：%@",itemInfo.typename];
    self.priceLabel.text = [NSString stringWithFormat:@"价格：%.2f",itemInfo.rateprice];
    
    if (![itemInfo.breakfast isEqualToString:@"含"]) {
        self.breakfastView.hidden = YES;
    }
    if (![itemInfo.broadband isEqualToString:@"免费"]) {
        self.wifiView.hidden = YES;
    }
    
    [self.coverImage sd_setImageWithURL:[NSURL URLWithString:itemInfo.cover_img]];
}

@end
